package com.vogue.supplymall.account.domain.dao.impl;

import java.util.List;
import java.util.Map;

import com.vogue.supplymall.common.domain.dto.admin.OrganSearchInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.vogue.supplymall.account.domain.dao.CodeDao;
import com.vogue.supplymall.account.domain.mapper.CodeMapper;
import com.vogue.supplymall.account.domain.model.BaseCode;

/**
 * Created by 崔岳 on 2017-12-1.
 */
@Repository("codeDao")
public class CodeDaoImpl extends BaseDaoImpl<BaseCode, Long> implements CodeDao{

    @Autowired
    private CodeMapper codeMapper;

	@Override
	public List<Map<Long, Long>> syscodeExisted() {
		return codeMapper.syscodeExisted();
	}
	
	@Override
	public List<Long> checkSysCodeValidity(Long sysCode) {
		List<Long> idList=codeMapper.checkSysCodeValidity(sysCode);
		return idList;
	}

	@Override
	public List<Long> checkSysCodeExist(String sysCodes) {
		List<Long> codeList=codeMapper.checkSyscodeExist(sysCodes);
		return codeList;
	}

	/**
	 * Find valid organ list.
	 * 开通集团-查询注册账号已申请但没开通的集团
	 *
	 * @return the list
	 */
	public List<Map<String,Object>> findValidOrgan(OrganSearchInfo organSearchInfo) {
		return codeMapper.findValidOrgan(organSearchInfo);
	}

	/**
	 * Find valid organ list.
	 * 开通集团-查询注册账号已申请但没开通的集团
	 * 查询总数
	 *
	 * @return the list
	 */
	@Override
	public Long findValidOrganCount(OrganSearchInfo organSearchInfo) {
		return codeMapper.findValidOrganCount(organSearchInfo);
	}
}
